#ifndef CUSTOMGLWIDGET_H
#define CUSTOMGLWIDGET_H

#include <QtOpenGL>

//Forward declarations
class QTimer;
struct CvCapture;
struct _IplImage;


//! Class CustomGLWidget
/**
 * This class represents a OpenGL widget capable to display frames
 * captured from a webcam. The class has the responsibility not only
 * for displaying the results, but also controlling the capture process.
 */
class CustomGLWidget: public QGLWidget
{
        Q_OBJECT;

  private:
        QTimer *m_timer;
        CvCapture *m_capture;
        _IplImage *m_image;

  public:
        CustomGLWidget(QWidget *parent=NULL);
        ~CustomGLWidget();

  protected:
        void initializeGL();
        void paintGL();


  private slots:
        void captureFrame();
};

#endif

